package dr.mini.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import dr.mini.dao.MemberDao;
import dr.mini.dao.MemberDaoImpl;
import dr.mini.domain.MemberCommand;

@Controller
public class SelectController{

	private static Log log = LogFactory.getLog(SelectController.class);
	
	private MemberDao memberDao;
	@Autowired
	public void setMemberDao(MemberDao memberDao) {
		this.memberDao = memberDao;
	}
	
	@RequestMapping("/detail.do")
	public ModelAndView process(@RequestParam("id") String id) {
		
		if (log.isDebugEnabled()) {
			log.debug("memberDaoImpl : " + memberDao);
		}
        MemberCommand member = memberDao.getMember(id);
		return new ModelAndView("select", "member", member);
	}
	
}
